﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.CodeDom.Compiler;

namespace RobotBattle2.Scripting {
	public class VariableDeclaration : AstNode {
		public VariableDeclaration() { }

		public VariableDeclaration(SymbolReference target, Expression initialValue) {
			this.Target = target;
			this.InitialValue = initialValue;
		}

		public SymbolReference Target { get; set; }
		public Expression InitialValue { get; set; }

		public override void Dump(IndentedTextWriter writer) {
			Target.Dump(writer);
			if (InitialValue != null) {
				writer.Write(" = ");
				InitialValue.Dump(writer);
			}
		}
	}
}
